export default config => {
    config.optimization
        .runtimeChunk(false) 
        .splitChunks({
            chunks: 'all',
            automaticNameDelimiter: '.',
            name: true,
            minSize: 10000,
            maxSize: 0,
            minChunks: 1,
            maxAsyncRequests: 10,
            maxInitialRequests: 5,
            // 包的拆分
            cacheGroups: {
                vendors: {
                    name: 'vendors',
                    chunks: 'all',
                    test: /[\\/]node_modules[\\/](react|react-dom|react-router|react-router-dom|lodash|lodash-decorators|redux-saga|re-select|dva)[\\/]/,
                    priority: 10,
                },
                antdesigns: {
                    name: 'antdesigns',
                    chunks: 'all',
                    test: /[\\/]node_modules[\\/](@ant-design|antd)[\\/]/,
                    priority: 9,
                },
                default: {
                    minChunks: 1,
                    priority: -20,
                    reuseExistingChunk: true,
                },
            },
        });
};
